package top.yokey.shopnc.model;

import top.yokey.base.base.BaseHttpClient;
import top.yokey.base.base.BaseHttpListener;

import java.util.HashMap;

@SuppressWarnings("ALL")
public class MemberEvaluateModel {

    private final String ACT = "member_evaluate";
    private static volatile MemberEvaluateModel instance;

    public static MemberEvaluateModel get() {
        if (instance == null) {
            synchronized (MemberEvaluateModel.class) {
                if (instance == null) {
                    instance = new MemberEvaluateModel();
                }
            }
        }
        return instance;
    }

    public void index(String orderId, BaseHttpListener baseHttpListener) {

        BaseHttpClient.get().ready(ACT, "index")
                .add("order_id", orderId)
                .get(baseHttpListener);

    }

    public void again(String orderId, BaseHttpListener baseHttpListener) {

        BaseHttpClient.get().ready(ACT, "again")
                .add("order_id", orderId)
                .get(baseHttpListener);

    }

    public void save(HashMap<String, String> hashMap, BaseHttpListener baseHttpListener) {

        BaseHttpClient.get().ready(ACT, "save")
                .add(hashMap)
                .post(baseHttpListener);

    }

    public void saveAgain(HashMap<String, String> hashMap, BaseHttpListener baseHttpListener) {

        BaseHttpClient.get().ready(ACT, "save_again")
                .add(hashMap)
                .post(baseHttpListener);

    }

}
